<template>
	<view class="xzcxzctrty">
		666

		<button type="default" @tap="jxcdsf">66677</button>

	</view>
</template>

<script setup>
	import {
		ref
	} from "vue";
	import {
		dxrequestqz
	} from "@/util/index.js"
	
	const innerAudioContext = uni.createInnerAudioContext();
	let audio = null
	innerAudioContext.autoplay = true;
	const jxcxzdf = async () => {
		const {
			data
		} = await uni.request({
			url: 'http://47.245.54.126:8360/dxtts',
			method: "post",
			responseType: "arraybuffer",
			data: {
				voice:"onyx",
				text: "清晨，薄雾笼罩着山谷，远处的群山若隐若现，仿佛仙境一般。阳光穿透云层，洒在翠绿的草地上，露珠闪烁，宛如无数颗钻石。小溪潺潺流淌，水声清脆悦耳，仿佛自然的乐章。鸟儿在树梢欢唱，蝴蝶在花丛中翩翩起舞，整个世界充满了生机与活力。傍晚时分，夕阳西下，天边的云霞被染成绚丽的橙红色，映照在湖面上，波光粼粼，美不胜收。夜幕降临，星空璀璨，月光洒在大地上，宁静而祥和。这片风景，无论何时何地，都让人心旷神怡，流连忘返。",
			}
		});
		let response = data
		const arrayBuffer = response;
		const blob = new Blob([arrayBuffer], {
			type: "audio/ogg; codecs=opus",
		});
		const url = URL.createObjectURL(blob);
		innerAudioContext.src = url
	}
	const jxcdsf = () => {
		innerAudioContext.play();
	}
	jxcxzdf()

</script>

<style lang="scss">
	.xzcxzctrty {
		width: 400rpx;
		height: 400rpx;
		background: red;
	}
</style>